package com.xianxin.redis.admin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * @author 贤心i
 * @email 1138645967@qq.com
 * @date 2020/01/29
 */
@SpringBootApplication
public class RedisServerApplication {

    /**
     * GuoTong
     * @param args
     */
    public static void main(String[] args) {
        SpringApplication sp = new SpringApplication(RedisServerApplication.class);
        sp.addListeners(new ApplicationPidFileWriter());
        ConfigurableApplicationContext applicationContext = sp.run(args);
        Environment env = applicationContext.getEnvironment();
        String port = env.getProperty("server.port");
        System.out.print("\n----------------------------------------------------------\n\t" +
                "Application is running! Access URL:\n\t" +
                "Local: \t\thttp://localhost:" + port + "/\n\t" +
                "----------------------------------------------------------\n\t");
    }
}
